package cc.yugu.yhdw.webserver.service.basic;

import cc.yugu.yhdw.common.domain.basic.DictItem;
import cc.yugu.yhdw.common.domain.basic.Feedback;
import cc.yugu.yhdw.common.entity.pagination.Page;
import cc.yugu.yhdw.webserver.persistence.basic.FeedbackMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 客户反馈评论业务
 * 
 * @Date:Created in 2018/7/3 17:11
 * @Author:
 * @Modified By: zjn 2018/7/3 17:11
 */ 
@Service
public class FeedbackService {
    @Autowired
    FeedbackMapper feedbackMapper;
    /**
    * 按主键查询
    * 
    * @Param: [id]
    * @Return: cc.yugu.yhdw.common.domain.basic.Feedback
    * @Author By: zjn 2018/7/3  17:11
    */ 
    public Feedback find(int id) {
        return feedbackMapper.find(id);
    }
    /**
    * 分页查询
    * 
    * @Param: [search]
    * @Return: cc.yugu.yhdw.common.entity.pagination.Page
    * @Author By: zjn 2018/7/3  17:11
    */ 
    public Page findPage(Feedback search) {
        Page page = search.buildPage();
        page.setTotalItems(feedbackMapper.findPageCount(search));
        search.setBeginIndex(page.getOffset());
        page.setResult(feedbackMapper.findPageResult(search));
        return page;
    }
    /**
    * 删除
    * 
    * @Param: [id]
    * @Return: int
    * @Author By: zjn 2018/7/3  17:12
    */ 
    public int delete(int id) {
        return feedbackMapper.delete(id);
    }


}
